import {http} from "../utils/http"
import {RoomDetailResponse} from "../model/RoomDetail"
import {RoomDetailParams} from "../model/RoomDetail"

interface reservationParams{
  name: string,
  date: string,
  houseId: string,
  phone: string,
  comment: string
}
interface reservationResponse{
  name: string,
  date: string,
  houseId: string,
  phone: string,
  comment: string
}
export  interface historyResponse{
  id: string,
  date: string,
  houseId: string,
  img: string,
  title: string,
  subTitle: string,

  rentPrice: string,
  comment: string
}
type historyList = historyResponse[];
export  const gethouseDetail=(params:RoomDetailParams):Promise<RoomDetailResponse>=>{
  return http.get<RoomDetailResponse>('/house/detail',params)
}
export  const reservation=(data:reservationParams):Promise<reservationResponse>=>{
  return http.post<reservationResponse>('/auth/house/reservation',data)
}
export  const history=():Promise<historyList>=>{
  return http.get<historyList>('/auth/house/history')
}

